#ifndef YSPUSHBUTTON_H
#define YSPUSHBUTTON_H

#include "touchbutton.h"
#include <QObject>
#include <QPushButton>

class YSPushButton : public TouchButton
{
    Q_OBJECT
public:
    explicit YSPushButton(QWidget *parent = nullptr);
     void setNormalIcon(const QIcon &icon);
    void setPressedIcon(const QIcon &icon);
signals:
    // QWidget interface
private slots:
    // 按钮按下时切换图标
    void onPressed();
    void onReleased();
protected:
    void showEvent(QShowEvent *event);
private:
    bool m_bFirst=true;
    QIcon m_normalIcon;
    QIcon m_pressedIcon;
};

#endif // YSPUSHBUTTON_H
